package com.moneywelcome.goldfacade;

import com.moneywelcome.goldfacade.dto.*;
import com.moneywelcome.goldfacade.vo.TrendVo;
import com.moneywelcome.results.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.io.IOException;
import java.util.List;


@FeignClient(
        contextId = "goldQueryApi",//服务名字
        value = "gold" // 区分不同client
)
public interface GoldQueryApi {
    @GetMapping("/queryAll")
    Result<List<GoldInfoDto>> queryALL();
    @GetMapping("/queryById")
    Result<GoldInfoDto> queryById(@RequestParam("goldId")Integer goldId);
    @GetMapping("/queryAggre")
    Result<GoldAgreementDto> queryAggre(@RequestParam("goldId")Integer goldId);
    @GetMapping("/querySubRule")
    Result<SubscribeRuleDto> querySubRule(@RequestParam("goldId")Integer goldId);
    @GetMapping("/queryRedeemRule")
    Result<RedeemRuleDto> queryRedeemRule(@RequestParam("goldId")Integer goldId);
    @PostMapping("/queryTrend")
    Result<TrendDto> queryTrend(@RequestBody TrendVo trendVo);
    @PostMapping("/queryTrendDay")
    Result<GoldTrendDto> queryTrendDay(@RequestParam("goldId") Integer goldId,@RequestParam("today") String today);
    @GetMapping("/currentInfo")
    Result<ProductInfoDto> getCurrentInfo(@RequestParam("goldId") String goldId) throws IOException;

}
